home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / oleo-1_4.lha / oleo-1.4 / io-abstract.h < prev    next >
C/C++ Source or Header  |  1993-03-26  |  5KB  |  181 lines

  1. #ifndef IO_ABSTRACTH
  2. #define IO_ABSTRACTH
  3. /*    Copyright (C) 1992, 1993 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with Oleo; see the file COPYING.  If not, write to
  17. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18. /*  t. lord    Fri Aug  7 12:48:16 1992    */
  19.  
  20. #ifdef DEFINE_IO_VARS
  21. #define EXTERN
  22. #else
  23. #define EXTERN extern
  24. #endif
  25.  
  26. #include "global.h"
  27. #include "line.h"
  28. #include "window.h"
  29.  
  30. #ifndef VOLATILE
  31. #ifdef __STDC__
  32. #define VOLATILE volatile
  33. #else
  34. #define VOLATILE
  35. #endif
  36. #endif
  37.  
  38. #ifdef __STDC__
  39. EXTERN void (*io_open_display) (void);
  40. EXTERN void (*io_redisp) (void);    /* Refresh the existing image. */
  41. EXTERN void (*io_repaint) (void);    /* $$$ Recompute the image. */
  42. EXTERN void (*io_repaint_win) (struct window *);
  43. EXTERN void (*io_close_display) (void);
  44.  
  45. /*
  46.  * Low level input.
  47.  */
  48. EXTERN int (*io_input_avail) (void);/* How many chars can be read? */
  49. EXTERN void (*io_scan_for_input) (int ok_to_block);
  50. EXTERN void (*io_wait_for_input) (void);
  51. EXTERN int (*io_read_kbd) (VOLATILE char *buf, int size);
  52.  
  53. /* A curses compatible interface.  These have no effect on low level
  54.    calls except to consume characters which io_read_kbd might
  55.    otherwise return. */
  56. EXTERN void (*io_nodelay) (int);
  57. EXTERN int (*io_getch) (void);
  58.  
  59. /* Annoy the user: */
  60. EXTERN void (*io_bell) (void);
  61.  
  62. /* High level i/o. */
  63.  
  64. EXTERN void (*io_flush) (void); 
  65.  
  66. /* Input and status areas: */
  67. EXTERN void (*io_clear_input_before) (void);
  68. EXTERN void (*io_clear_input_after) (void);
  69. EXTERN void (*io_update_status) (void);
  70. EXTERN int (*io_get_chr) (char *prompt);
  71.  
  72. EXTERN void (*io_fix_input) (void);
  73. EXTERN void (*io_move_cursor) (void);
  74. EXTERN void (*io_erase) (int len);
  75. EXTERN void (*io_insert) (int len);
  76. EXTERN void (*io_over) (char *, int len);
  77.  
  78. #ifdef HAVE_X11_X_H
  79. #ifdef __STDC__
  80. extern int io_col_to_input_pos (int col);
  81. #else
  82. extern int io_col_to_input_pos ();
  83. #endif
  84. #else
  85. #define io_col_to_input_pos(i)  0
  86. #endif
  87.  
  88.  
  89. /* Cell values */
  90. EXTERN void (*io_hide_cell_cursor) (void);
  91. EXTERN void (*io_display_cell_cursor) (void);
  92. EXTERN void (*io_pr_cell_win) (struct window *,
  93.                    CELLREF, CELLREF,
  94.                    CELL *);
  95.  
  96. /* The terminal's cursor may be in the current cell or the input area. */
  97. EXTERN void (*io_cellize_cursor) (void);
  98. EXTERN void (*io_inputize_cursor) (void);
  99. #else
  100. EXTERN void (*io_open_display) ();
  101. EXTERN void (*io_redisp) ();    /* Refresh the existing image. */
  102. EXTERN void (*io_repaint) ();    /* $$$ Recompute the image. */
  103. EXTERN void (*io_repaint_win) ();
  104. EXTERN void (*io_close_display) ();
  105.  
  106. /*
  107.  * Low level input.
  108.  */
  109. EXTERN int (*io_input_avail) ();/* How many chars can be read? */
  110. EXTERN void (*io_scan_for_input) ();
  111. EXTERN void (*io_wait_for_input) ();
  112. EXTERN int (*io_read_kbd) ();
  113.  
  114. /* A curses compatible interface.  These have no effect on low level
  115.    calls except to consume characters which io_read_kbd might
  116.    otherwise return. */
  117. EXTERN void (*io_nodelay) ();
  118. EXTERN int (*io_getch) ();
  119.  
  120. /* Annoy the user: */
  121. EXTERN void (*io_bell) ();
  122.  
  123. /* High level i/o. */
  124.  
  125. EXTERN void (*io_flush) (); 
  126.  
  127. /* Input and status areas: */
  128. EXTERN void (*io_clear_input_before) ();
  129. EXTERN void (*io_clear_input_after) ();
  130. EXTERN void (*io_update_status) ();
  131. EXTERN int (*io_get_chr) ();
  132.  
  133. EXTERN void (*io_fix_input) ();
  134. EXTERN void (*io_move_cursor) ();
  135. EXTERN void (*io_erase) ();
  136. EXTERN void (*io_insert) ();
  137. EXTERN void (*io_over) ();
  138.  
  139. /* Cell values */
  140. EXTERN void (*io_hide_cell_cursor) ();
  141. EXTERN void (*io_display_cell_cursor) ();
  142. EXTERN void (*io_pr_cell_win) ();
  143.  
  144. /* The terminal's cursor may be in the current cell or the input area. */
  145. EXTERN void (*io_cellize_cursor) ();
  146. EXTERN void (*io_inputize_cursor) ();
  147. #endif
  148.  
  149.  
  150. #define IO_SETUP                        \
  151.   io_open_display = _io_open_display;                \
  152.   io_redisp = _io_redisp;                    \
  153.   io_repaint = _io_repaint;                    \
  154.   io_repaint_win = _io_repaint_win;                \
  155.   io_close_display = _io_close_display;                \
  156.   io_input_avail = _io_input_avail;                 \
  157.   io_scan_for_input = _io_scan_for_input;             \
  158.   io_wait_for_input = _io_wait_for_input;             \
  159.   io_read_kbd = _io_read_kbd;                     \
  160.   io_nodelay = _io_nodelay;                     \
  161.   io_getch = _io_getch;                     \
  162.   io_bell = _io_bell;                         \
  163.   io_get_chr = _io_get_chr;                     \
  164.   io_update_status = _io_update_status;                   \
  165.   io_fix_input = _io_fix_input;                    \
  166.   io_move_cursor = _io_move_cursor;                \
  167.   io_erase = _io_erase;                        \
  168.   io_insert = _io_insert;                    \
  169.   io_over = _io_over;                        \
  170.   io_flush = _io_flush;                        \
  171.   io_clear_input_before = _io_clear_input_before;        \
  172.   io_clear_input_after = _io_clear_input_after;         \
  173.   io_pr_cell_win = _io_pr_cell_win;                \
  174.   io_hide_cell_cursor = _io_hide_cell_cursor;            \
  175.   io_cellize_cursor = _io_cellize_cursor;            \
  176.   io_inputize_cursor = _io_inputize_cursor;            \
  177.   io_display_cell_cursor = _io_display_cell_cursor
  178.  
  179.  
  180. #endif
  181.